/**
 * 
 */
package com.gametime.model;

/**
 * @author dave
 *
 */
public class Team {
	
	
	private int teamId;
	private String club;
	private String locale;
	private String venue;
	
	public Team(int teamId, String club, String locale, String venue)
	{
		this.teamId = teamId;
		this.club = club;
		this.locale = locale;
		this.venue = venue;
	}
	/**
	 * @return the coach
	 */
	public Person getCoach() {
		return coach;
	}

	/**
	 * @return the generalManager
	 */
	public Person getGeneralManager() {
		return generalManager;
	}

	private String teamName;
	private Person coach;
	private Person generalManager;
	
	public int getTeamId() 
	{
		return teamId;
	}
	
	public String getClub() 
	{
		return club;
	}
	
	public String getLocale() 
	{
		return locale;
	}
	
	public String getVenue() 
	{
		return venue;
	}
	
	public String getTeamName() 
	{
		if(teamName == null && isComplete())
			teamName = locale + " " + club;
		
		return teamName;
	}
	
	private boolean isComplete()
	{
		if(locale != null && club != null)
			return true;
		else
			return false;
	}
	
	public String toString()
	{
	  return "<Team id='" + this.teamId + "' local='" + this.locale+ "' club='" + this.club + "' />";
	}
	

}
